package com.lablzh.gdxy.service;

import com.lablzh.gdxy.entity.admin.Material;
import com.lablzh.gdxy.entity.admin.News;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface FileService {
    void downloadFile(String filepath, HttpServletRequest request,
                      HttpServletResponse response) throws FileNotFoundException;

    //   Map<String,String> uploadFile(MultipartFile uploadFile,
//                                 HttpServletRequest req,
//                                 String username) throws IOException;
    Map<String, String> summitFile(
            HttpServletRequest req,
            String category,
            Integer id) throws IOException;

    void reviewFile(String category,
                    Integer id,
                    String filename,
                    HttpServletRequest request,
                    HttpServletResponse response) throws FileNotFoundException;

    Boolean deleteFile(String filePath);


    String addMaterial(HttpServletRequest request, String columns, String category) throws Exception;

    String deleteMaterial(Integer id);

    Map getAllMaterial(Integer page, Integer limit, String column);

    String addNews(News news);

    String updateNews(News news);

    News getOneNews(Integer id);

    News getNewsByTitle(String title);

    List<News> getAllNews();

    String deleteNews(Integer id);

    void downloadEnclosureFile(String category,
                               Integer id,
                               String filename,
                               HttpServletRequest request,
                               HttpServletResponse response
    ) throws FileNotFoundException;

    Map<String, String> summitEnclosureFile(
            HttpServletRequest request,
            String category,
            Integer id) throws IOException;

    Map<String, String> summitCourseFile(HttpServletRequest request, Integer id) throws IOException;

    void downloadCourseFile(String filename, Integer id, HttpServletRequest request, HttpServletResponse response) throws FileNotFoundException;

    List<Material> getAllMaterial();

//    void downloadCourseFile();
}
